/*
 * @(#)DrawFigureFactory.java  1.0  February 17, 2004
 *
 * Copyright (c) 1996-2006 by the original authors of JHotDraw
 * and all its contributors ("JHotDraw.org")
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JHotDraw.org ("Confidential Information"). You shall not disclose
 * such Confidential Information and shall use it only in accordance
 * with the terms of the license agreement you entered into with
 * JHotDraw.org.
 */

package umage.core;

import java.util.ArrayList;
import java.util.List;

import org.jhotdraw.draw.ArrowTip;
import org.jhotdraw.draw.AttributeKeys;
import org.jhotdraw.draw.BezierFigure;
import org.jhotdraw.draw.ChopBezierConnector;
import org.jhotdraw.draw.ChopBoxConnector;
import org.jhotdraw.draw.ChopDiamondConnector;
import org.jhotdraw.draw.ChopEllipseConnector;
import org.jhotdraw.draw.ChopRoundRectConnector;
import org.jhotdraw.draw.ChopTriangleConnector;
import org.jhotdraw.draw.DefaultDrawing;
import org.jhotdraw.draw.DiamondFigure;
import org.jhotdraw.draw.ElbowLiner;
import org.jhotdraw.draw.EllipseFigure;
import org.jhotdraw.draw.GroupFigure;
import org.jhotdraw.draw.LineConnectionFigure;
import org.jhotdraw.draw.LineFigure;
import org.jhotdraw.draw.QuadTreeDrawing;
import org.jhotdraw.draw.RectangleFigure;
import org.jhotdraw.draw.RoundRectangleFigure;
import org.jhotdraw.draw.TextAreaFigure;
import org.jhotdraw.draw.TextFigure;
import org.jhotdraw.draw.TriangleFigure;
import org.jhotdraw.xml.DefaultDOMFactory;
/**
 * DrawFigureFactory.
 *
 * @author  Werner Randelshofer
 * @version 1.0 February 17, 2004 Created.
 */
public class UMageFigureFactory extends DefaultDOMFactory {
    private final static List<Class<?>> classTagArray = new ArrayList<Class<?>>();
    private final static List<Class<?>> enumTagArray = new ArrayList<Class<?>>();
    
    static {
    	addEnumClass(AttributeKeys.StrokePlacement.class);
    	addEnumClass(AttributeKeys.StrokeType.class);
    	addEnumClass(AttributeKeys.Underfill.class);
    	addEnumClass(AttributeKeys.Orientation.class);
    }
    
    public static void addStorableClass(Class<?> c) {
    	classTagArray.add(c);
    }
    
    public static void addEnumClass(Class<?> c) {
    	enumTagArray.add(c);
    }
    
    /** Creates a new instance. */
    public UMageFigureFactory() {
        for (Class<?> c : classTagArray) {
            addStorableClass(c.getSimpleName(), c);
        }
        for (Class<?> c : enumTagArray) {
            addEnumClass(c.getSimpleName(), c);
        }
    }
}
